import { notAllowSpecialCharacters } from "@/utils/validate"

import CommonInput from "../../common/commonInput"

const TableCode = ({ onChange, ...props }: { props?: object; onChange?: (value: string) => void }) => {
	const onNotAllow = (value: string) => {
		onChange && onChange(value)
	}
	return (
		<CommonInput
			fieldName="tableCode"
			placeholderId="dxn.card_ables_list.table_id_placeholder"
			labelId="dxn.card_ables_list.table_id"
			onChange={e => notAllowSpecialCharacters(e, onNotAllow)}
			{...props}
		/>
	)
}

export default TableCode
